import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/HomeView.vue')
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('../views/UserView.vue')
  },{
    path: '/article',
    name: 'article',
    component: () => import('../views/ArticleView.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/RegisterView.vue')
  },
  {
    path: '/select',
    name: 'select',
    component: () => import('../views/ArticleSelectView.vue')
  },
  {
    path: '/editblog',
    name: 'editblog',
    component: () => import('../views/EditBlogView.vue')
  },
  {
    path: '/chat',
    name: 'chat',
    component: () => import('../views/ChatView.vue')
  },
  {
    path: '/profile',
    component: () => import('../views/ProfileView.vue'),
    children: [{
      path: '/',
      name: 'profileInfo',
      component: () => import('../views/ProfileEditInfoView.vue')
    },{
      path: '/profileInfo',
      name: 'profileInfo',
      component: () => import('../views/ProfileEditInfoView.vue')
    }, {
      path: '/profilePass',
      name: 'profilePass',
      component: () => import('../views/ProfileEditPassView.vue')
    }, {
      path: '/profileDelete',
      name: 'profileDelete',
      component: () => import('../views/ProfileDeleteView.vue')
    }]
  },
  {
    path: '/admin',
    name: 'admin',
    component: () => import('../views/admin/AdminView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
